package com.smarttiger.zero.admin.dao;

import com.smarttiger.zero.admin.entity.MenuModel;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface MenuDao extends BaseDao<MenuModel> {

    public List<MenuModel> getMenuModelsByParentIdIsNull();

    public List<MenuModel> getAllByParentId(String parentId);

    @Modifying
    @Query("delete from MenuModel ")
    public void deleteAllMenu();
}
